import sys
from python_ai.common.xcommon import *
import tensorflow as tf

a = tf.reshape(tf.range(1, 12+1, dtype=tf.float32), [3, 4])
print(a)
a = tf.Variable(a)
print(a)
tf.print(a, output_stream=sys.stdout)

sep('[:, 1].assign')
a[:, 1].assign(tf.constant([11, 22, 33], dtype=tf.float32))
tf.print(a, output_stream=sys.stdout)

# a[:, 2] = tf.constant([11, 22, 33], dtype=tf.float32)  # TypeError: 'ResourceVariable' object does not support item assignment
